<template>
    <div>
        <el-select 
        v-model="formInline.recipe"
         @change="oncheng"
        clearable
         size="mini"
         style="margin-left:5px; margin-top:8px;width:140px" placeholder="请选择内容">
                 <el-option :label="item"  
                  :value="item" v-for="(item,index) in this.items" :key="index">  
                 </el-option>
        </el-select>
    </div>
</template>

<script>
    export default {
        props:{
            modlulist:Array,
            formInline:Object
        },
        data(){
            return{
                options1:this.modlulist,
                formInline1:this.obj,
                items:[]
            }
        },
       watch:{
            modlulist(newVal){
            this.options1 = newVal;
                for(let i=0;i<this.options1.length;i++){
                    var shortname = this.options1[i].shortname+' | ';
                    var conID = this.options1[i].id;
                    var contStr = shortname.concat(conID);
                    this.items.push(contStr)
                }
            }
       },
          
          methods:{
             oncheng(){
               var pram = this.formInline.recipe;
               var str  =  pram.indexOf(" ");
               var newStr = pram.substr(str+3)
               this.formInline.recipe = newStr;
             }
          },

         created() {
           
         },
    }
</script>

<style  scoped>

</style>